//
//  RmdSimpleCell.m
//  Travel assistant
//
//  Created by 杨帆 on 16/3/10.
//  Copyright © 2016年 旅游助手. All rights reserved.
//

#import "RmdSimpleCell.h"

#define KScreenWidth [[UIScreen mainScreen] bounds].size.width
#define KScreenHeight [[UIScreen mainScreen] bounds].size.height

@implementation RmdSimpleCell


-(instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier{
    
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    
    if (self) {
        
        [self addViews];
    }
    
    return self;
}


-(void)addViews{
    
    
    self.mainImageV.frame = CGRectMake(0.031*KScreenWidth, 0.018*KScreenHeight, 0.937*KScreenWidth, 0.317*KScreenHeight);
    
//    self.mainImageV.backgroundColor = [UIColor yellowColor];
    self.mainImageV.layer.cornerRadius = 10;
    self.mainImageV.layer.masksToBounds = YES;
    [self.contentView addSubview:self.mainImageV];
    
    self.cover_titleL.frame = CGRectMake(0.031*KScreenWidth, 0.105*KScreenHeight, 0.94*KScreenWidth, 0.044*KScreenHeight);
    
//    self.cover_titleL.backgroundColor = [UIColor redColor];
    self.cover_titleL.textColor = [UIColor whiteColor];
    self.cover_titleL.textAlignment = NSTextAlignmentCenter;
    self.cover_titleL.font= [UIFont fontWithName:@"Helvetica-Bold" size:24];
    [self.contentView addSubview:self.cover_titleL];
    
    self.cover_sub_titleL.frame = CGRectMake(0.031*KScreenWidth, 0.159*KScreenHeight, 0.94*KScreenWidth, 0.023*KScreenHeight);
    
//    self.cover_sub_titleL.backgroundColor = [UIColor greenColor];
    self.cover_sub_titleL.font = [UIFont systemFontOfSize:12];
    self.cover_sub_titleL.textAlignment = NSTextAlignmentCenter;
    self.cover_sub_titleL.textColor = [UIColor whiteColor];
    [self.contentView addSubview:self.cover_sub_titleL];
    
    
    
}



-(UIImageView *)mainImageV{
    
    
    if (!_mainImageV) {
        _mainImageV = [UIImageView new];
    }
    return _mainImageV;
}


-(UILabel *)cover_titleL{
    
    if (!_cover_titleL) {
        
        _cover_titleL = [UILabel new];
    }
    
    return _cover_titleL;
}


-(UILabel *)cover_sub_titleL{
    
    if (!_cover_sub_titleL) {
        
        _cover_sub_titleL = [UILabel new];
        
    }
    
    return _cover_sub_titleL;
    
}


-(void)layoutSubviews{
    
    [super layoutSubviews];
    
    
    self.mainImageV.frame = CGRectMake(0.031*KScreenWidth, 0.018*KScreenHeight, 0.937*KScreenWidth, 0.317*KScreenHeight);
    
    self.cover_titleL.frame = CGRectMake(0.031*KScreenWidth, 0.105*KScreenHeight, 0.94*KScreenWidth, 0.044*KScreenHeight);
    
    self.cover_sub_titleL.frame = CGRectMake(0.031*KScreenWidth, 0.159*KScreenHeight, 0.94*KScreenWidth, 0.023*KScreenHeight);

    
}


- (void)awakeFromNib {
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
